<?php

use Illuminate\Database\Capsule\Manager as DB;

class User_signController extends CommonController
{
    // 按月份获取签到记录
    public function indexAction()
    {
        $month = $this->get('month');
        try {
            Validate::check(['month' => $month], [
                'month' => ['role'=>'required', 'msg'=>'月份'],
            ]);
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
        json(['code' => 1, 'msg' => '发送成功', 'data' => membersignModel::getList($month)]);
    }


    public function signAction() {
        $params = $this->getPost();
        $score = membersignModel::sign($params);
        json(['code' => 1, 'msg' => '发送成功', 'data' => ['score' => $score]]);
    }
}
